#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.lib.sh"

run_behat() {
    local code=0

    print_header "Testing (Behat - CLI commands, regular scenarios; @cli && ~@todo)" "Sylius"
    run_command "bin/behat --strict --no-interaction -vvv -f progress -p cached --tags=\"@cli && ~@todo\"" || code=$?
    if [[ ${code} = 1 ]]; then
        run_command "bin/behat --strict --no-interaction -vvv -f progress -p cached --tags=\"@cli && ~@todo\" --rerun" ; code=$?
    fi

    return ${code}
}

run_behat
